#pragma once

#include"Graph.h"

inline std::vector<edge> MakeRandomEdges(int vertices_number){
    if(vertices_number < 1){
        throw std::logic_error("Cannot make Graph with 0 or less vertices");
    }
    std::vector<edge> edges;
    int edges_number = rand()%(vertices_number*vertices_number - vertices_number + 1);
    for(int current_edge = 0; current_edge < edges_number;current_edge++){
        int from = rand()%vertices_number;
        int to = rand()%vertices_number;
        if(from != to){
            edge new_edge (from,to);
            edges.push_back(new_edge);
        }
    }
    return edges;
}


inline std::vector<edge> MakeRandomAcyclicGraphEdges(int vertices_number){
    if(vertices_number < 1){
        throw std::logic_error("Cannot make Graph with 0 or less vertices");
    }
    std::vector<edge> edges;
    int edges_number = rand()%(2*vertices_number - 1);
    for(int current_edge = 0; current_edge < edges_number;current_edge++){
        int from = rand()%vertices_number;
        int to = rand()%vertices_number;
        int max = std::max(from,to);
        int min = std::min(from,to);
        to = min;
        from = max;
        if(from != to){
            edge new_edge (from,to);
            edges.push_back(new_edge);
        }
    }
    return edges;
}

inline std::vector<edge> MakeFullGraphEdges(int vertices_number){
    if(vertices_number < 1){
        throw std::logic_error("Cannot make Graph with 0 or less vertices");
    }
    std::vector<edge> edges;
    for(int from = 0; from < vertices_number; from++){
        for(int to = 0; to < vertices_number; to++){
            if(from != to){
                edge new_edge (from, to);
                edges.push_back(new_edge);
            }
        }
    }
    return edges;
}